package com.baozhun.mall.common.adapter

import com.baozhun.mall.common.model.bean.GoodsInfoBean
import com.baozhun.mall.common.provider.ChannelGoodsProvider
import com.baozhun.mall.common.provider.HomeSpecProvider
import com.baozhun.mall.common.provider.PlatformSloganProvider
import com.chad.library.adapter.base.BaseProviderMultiAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.orhanobut.logger.Logger

/**
 * @Title：首页分类商品适配器
 * @Description：
 * @Author：xuefeng.zhu
 * @Since：2024/1/24
 * @Version：1.0.0
 */
class HomeCategoryGoodsAdapter : BaseProviderMultiAdapter<GoodsInfoBean>(), LoadMoreModule {

    init {
        addItemProvider(PlatformSloganProvider())
        addItemProvider(ChannelGoodsProvider())
        addItemProvider(HomeSpecProvider())
    }

    override fun getItemType(data: List<GoodsInfoBean>, position: Int): Int {
        return data[position].itemType
    }
}
